package com.ustc.hewei.consumerweb.utils;

import com.ustc.hewei.commonmodule.dto.UserDTO;

/**
* @description: TODO
* @author hewei
* @date 2022/10/5 19:50
* @version 1.0
*/

public class UserHolder {
    private static final ThreadLocal<UserDTO> tl = new ThreadLocal<>();

    public static void saveUser(UserDTO user){
        tl.set(user);
    }

    public static UserDTO getUser(){
        return tl.get();
    }

    public static void removeUser(){
        tl.remove();
    }
}
